#include <material/editoreffect.h>
#include <session.h>

EditorEffect::EditorEffect()
{
  _effect = Session::Get()->GetDevice()->CreateEffect();
  if (_effect)
    {
      _effect->AddRef();
    }
}

EditorEffect::~EditorEffect()
{
  CE_UNSET(_effect);
}


iEffect* EditorEffect::GetSource()
{
  return _effect;
}

void EditorEffect::ClearEffectPrograms()
{
  _effect->ClearEffectPrograms();
}

void EditorEffect::AddEffectProgram(iEffectProgram *program)
{
  _effect->AddEffectProgram(program);
}

bool EditorEffect::RemoveEffectProgram(iEffectProgram *program)
{
  return _effect->RemoveEffectProgram(program);
}

void EditorEffect::SetSolver(iLevelOfDetailSolver *solver)
{
  _effect->SetSolver(solver);
}

iEffectProgram* EditorEffect::Eval(float v)
{
  return _effect->Eval(v);
}
